<template>
	<div class="_p20">
		<el-input v-model="url" />
		<el-input v-model="data" />

		<el-select v-model="method">
			<el-option label="GET" value="GET" />
			<el-option label="POST" value="POST" />
			<el-option label="PUT" value="PUT" />
			<el-option label="DELETE" value="DELETE" />
		</el-select>
		
		<el-button type="primary" @click="submit">发起请求</el-button>
		
	</div>
</template>

<script setup>
	import ToolHttp from "@/tool/http/ToolHttp.js"
	import {
		ref
	} from "vue";

	let url = ref('json-server/test')
	let method = ref('GET')
	let data = ref()
	let examplesData = ref('{}')

	function submit() {
		ToolHttp.request(url.value, data.value, method.value).then(res => {
			console.log(res)
		})
	}
</script>

<style scoped>

</style>
